package com.five.monkey.feign.consumer.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @author jim
 * @desc
 * @date 2021-08-10 22:01
 */
@ControllerAdvice
public class GlobalException {

    private static Logger logger = LoggerFactory.getLogger(GlobalException.class);


    @ExceptionHandler(value = {Exception.class})
    public String exception(Exception e) {
        logger.error("未知异常。", e);
        return e.getMessage();
    }
}
